/*
 *  ekk_subtitle_dec_pic.c
 *  EKK_Player_Lib
 *
 *  Created by xl on 11-7-21.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include "ekk_base/ekk_define.h"
#include "ekk_subtitle/ekk_subtitle_dec_pic.h"

#import "ekk_subtitle/ios_dec_subtitle.h"

#if EKK_ENABLE_SUBTITLE

static DEC_SUBTITLE_PROXY g_dec_subtitle_proxy = {0};

void dec_proxy_subtitle_init()
{
#ifdef EKK_OS_IOS
	g_dec_subtitle_proxy.dec_subtitle_proxy_init=ios_dec_subtitle_init;
	g_dec_subtitle_proxy.dec_subtitle_proxy_uninit=ios_dec_subtitle_uninit;
	g_dec_subtitle_proxy.dec_subtitle_proxy_creat = ios_dec_subtitle_create;
	g_dec_subtitle_proxy.dec_subtitle_proxy_close = ios_dec_subtitle_close;
	g_dec_subtitle_proxy.dec_set_attribute_subtitle_proxy =ios_dec_set_attribute_subtitle;
	g_dec_subtitle_proxy.dec_get_attribute_subtitle_proxy =ios_dec_get_attribute_subtitle;
	g_dec_subtitle_proxy.dec_subtitle_to_bitmap_proxy = ios_dec_subtitle_to_bitmap;
	g_dec_subtitle_proxy.dec_subtitle_get_empty_bitmap_proxy = ios_dec_subtitle_get_empty_bitmap;
	g_dec_subtitle_proxy.head = 8;
#endif		
} 
void dec_subtitle_init()
{
	if(g_dec_subtitle_proxy.head ==0)
	{
		dec_proxy_subtitle_init();
	}
	g_dec_subtitle_proxy.dec_subtitle_proxy_init();
}
void dec_subtitle_uninit()
{
	g_dec_subtitle_proxy.head = 0;
	g_dec_subtitle_proxy.dec_subtitle_proxy_uninit();
}
DEC_SUBTITLE_HANDLE dec_subtitle_creat()
{
	return (DEC_SUBTITLE_HANDLE)g_dec_subtitle_proxy.dec_subtitle_proxy_creat();
}
void dec_subtitle_close(DEC_SUBTITLE_HANDLE hd)
{
	g_dec_subtitle_proxy.dec_subtitle_proxy_close(hd);
}	
void dec_set_attribute_subtitle(int* x,int* y,unsigned long* rgba,char* fonttype,int* fontsize,DEC_SUBTITLE_HANDLE hd)
{
	g_dec_subtitle_proxy.dec_set_attribute_subtitle_proxy(x,y,rgba,fonttype,fontsize,hd);
}
void dec_get_attribute_subtitle(int* x,int* y,unsigned long* rgba,char** fonttype,int* fontsize,DEC_SUBTITLE_HANDLE hd)
{
	g_dec_subtitle_proxy.dec_get_attribute_subtitle_proxy(x,y,rgba,fonttype,fontsize,hd);
}
void dec_subtitle_to_bitmap(unsigned char** bitmap,char* txt,DEC_SUBTITLE_HANDLE hd)
{
	g_dec_subtitle_proxy.dec_subtitle_to_bitmap_proxy(bitmap,txt,hd);
		
}	
void dec_subtitle_get_empty_bitmap(unsigned char** bitmap,DEC_SUBTITLE_HANDLE hd)
{
	g_dec_subtitle_proxy.dec_subtitle_get_empty_bitmap_proxy(bitmap,hd);
}

#endif/*#if EKK_ENABLE_SUBTITLE*/
